{% extends "admin/base.html" %}
{%load pagination%}
{% block content %}
<div class="wrap">
 	<h2>编辑页面</h2>
 	<form id="posts-filter" action="/admin/post_delete" method="post">
 		<ul class="subsubsub">
 			<li>
 				<a href="?post_status=all">
 				全部<span class="count">({{all_count}})</span>
 				</a>
 				|
 			</li>
 			<li>
 				<a href="?post_status=publish">
 				已发布<span class="count">({{publish_count}})</span>
 				</a>
 			</li>
 		</ul>
 		<p class="search-box hidden">
			<label class="hidden" for="post-search-input">搜索文章:</label>
			<input class="search-input" id="post-search-input" name="s" value="" type="text">
			<input value="搜索文章" class="button" type="submit">
 		</p>
 		<div class="tablenav">
 			<div class="alignleft actions">
			<input type="submit" class="button-secondary action" id="doaction" name="delete" value="批量删除">
 			</div>
 		</div>
 		<div class="clear"></div>
 		<table class="widefat">
			<thead>
				<tr>
				<th scope="col" class="check-column">
				<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>标题</th>
				<th style="width: 15%;">日期</th>
				<th>作者</th>
				<th scope="col" class="num"><div class="vers"><img alt="Comments" src="/static/images/comment-grey-bubble.png"></div></th>
				<th>状态</th><th>允许评论</th></tr>
			</thead>
			<tfoot>
				<tr>
				<th scope="col" class="check-column">
				<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>标题</th>
				<th style="width: 15%;">日期</th>
				<th>作者</th>
				<th scope="col" class="num"><div class="vers"><img alt="Comments" src="/static/images/comment-grey-bubble.png"></div></th>
				<th>状态</th><th>允许评论</th></tr>
			</tfoot>
			<tbody>
         {%if entrys%}
         {%begin_pagination entrys page %}
         {%for entry in entrys%}
		<tr valign="middle" id="link-474002">
			<th scope="row" class="check-column">
				<input type="checkbox" name="checks" value="{{entry.id}}">
			</th>
			<td> 
              	<a href="/admin/editpost/{{entry.id}}?entrytype=page" title="Edit &quot;{{entry.title}}&quot;" style="color: gray;" class="row-title">[编辑]</a> 
              	<strong>
              		{%if entry.published%}
              		<a target="_blank" href="{{entry.fullurl}}" title="{{entry.title}}" class="row-title">{{entry.title}}</a>
              		{%else%}
              		<a target="_self" href="/admin/editpost/{{entry.id}}" title="Edit &quot;{{entry.title}}&quot;" class="row-title">{{entry.title}}</a>
              		{%endif%}
              	</strong>
              </td>
              <td>{{entry.date|date:"Y-m-d"}}</td>
              
              <td>{{entry.author.username}}</td>
              <td scope="col" class="num">{{entry.comments.count}}</td>
              <td>{%if entry.published%}发布{%else%}未发布{%endif%}</td>
              <td>{%if entry.allow_comment%}Yes{%else%}No{%endif%}</td>
		</tr>
		{%endfor%}
		{%else%}
		<tr>
			<td colspan="7" align="center" style="font-size: 16px;">还没有新文章,<a href="/admin/page">添加</a>一篇吧</td>
		</tr>
		{%endif%}
			</tbody>
		</table>
 	</form>
 	 <!-- pagenavi start -->
 	 {%if entrys%}
		  {%end_pagination%}
	{%endif%}
		<!-- pagenavi end -->
</div>
{%endblock%}